#ifndef REGEXP_H_
#define REGEXP_H_

#include <iostream>
#include <set>
#include <string>
#include <iterator>

using namespace std;

class Regexp {
public:
	enum Operator {PLUS, STAR, OR, DOT, ONE, START};
	Regexp();
	Regexp(string p);
	virtual ~Regexp();
	
	int compareString(string s1, string s2);
	set <string>  getLanguage(int maxSteps);
	Regexp *plus();
	Regexp *star();
	Regexp *or(Regexp *e2);
	Regexp *dot(Regexp *e2);
	void sort(set<string> &sourceSet);
	Operator &getOperator();
	bool operator ==(const Regexp &other) const;
	
private:
	Regexp *left;
    Regexp *right;
protected:
	string terminals;
	Operator _operator;
};
ostream& operator <<(ostream &os, const set<string> &exp);
#endif